<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<%@ page language="java" contentType="text/html"%>

<html>

<head>
	<title></title>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<link rel="stylesheet" type="text/css" href="../css/base.css" media="all" />
	<script type="text/javascript">
<!--
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>

<script type="text/javascript">
function JsMenuView(id) {

	var imgName;
	var re;

	for(i=1 ; i<=4 ; i++) {
		imgName = "../images/common/top_menu0"+i+"_off.gif";
		re = "menu_"+i+"_img";
		document.getElementById(re).src = imgName;
		document.getElementById("submenu_"+i).style.display="none";
	}

	imgName = "../images/common/top_menu0"+id+"_on.gif";
	document.getElementById("menu_"+id+"_img").src = imgName;
	if(document.getElementById("submenu_"+id)){
		document.getElementById("submenu_"+id).style.display="block";
	}
}
</script>

</head>

<body id="wrap_bg">
<div id="accessibility">
	<h1 class="hidden"><a href="/">logo</a></h1>
	<h2 class="hidden"></h2>
	<ul>
		<li><a href="#hearder">main_menu</a></li>
		<li><a href="#left_part">sub_menu</a></li>
		<li><a href="#body_part">contacts</a></li>
		<li><a href="#foot">copyright</a></li>
	</ul>
</div>
<div id="wrap">
	<h2 class="hidden">main_menu</h2>
	<div id="hearder">
<%if(request.getParameter("admin") == null){%>
		<h1><div id="logo"><a href="../index.html"><img src="../images/common/logo.gif" alt="logo" /></a></div></h1>
<%}else if(request.getParameter("admin").equals("administrator3k")){%>		
		<h1><div id="logo"><a href="../main?admin=administrator3k"><img src="../images/common/logo.gif" alt="logo" /></a></div></h1>
<%}%>

		<div id="top_menu">
			<div id="navi-global">
				<%if(request.getParameter("admin") == null){%>
				<ul>
					<li id="menu_1">
						<a href="whatis.html" onmouseover="JsMenuView('1');" onfocus="JsMenuView('1'),this.blur();"><img src="../images/common/top_menu01_off.gif" alt="Biz-Ring" border="0" id="menu_1_img" /></a>
						<ul id="submenu_1">
							<li class="text_fff"><a href="whatis.html" class="top_menu" onfocus="this.blur()">What is Biz-Ring</a>&nbsp;&nbsp;|&nbsp;&nbsp;</li>
							<li class="text_fff"><a href="biz-ring.html" class="top_menu" onfocus="this.blur()">Biz-Ring Now</a>&nbsp;&nbsp;|&nbsp;&nbsp;</li>
							<li class="text_fff"><a href="Advertising Schedule_list.html" class="top_menu" onfocus="this.blur()">Advertising Schedule</a>&nbsp;&nbsp;|&nbsp;&nbsp;</li>
							<li class="text_fff"><a href="notice_list.html" class="top_menu" onfocus="this.blur()">Notice</a>&nbsp;&nbsp;|&nbsp;&nbsp;</li>
							<li class="text_fff"><a href="price.html" class="top_menu" onfocus="this.blur()">Price Notice</a></li>
						</ul>
					</li>
					<li id="menu_2">
						<a href="../prize/prize now.html" onMouseOver="JsMenuView('2'),this.blur()" onFocus="JsMenuView('2'),this.blur();"><img src="../images/common/top_menu02_off.gif" alt="Prize" border="0" id="menu_2_img" /></a>
						<ul id="submenu_2">
							<li class="text_fff"><a href="../prize/prize now.html" class="top_menu" onfocus="this.blur()">Prize Now</a>&nbsp;&nbsp;|&nbsp;&nbsp;</li>
							<li class="text_fff"><a href="../prize/last month.html" class="top_menu" onfocus="this.blur()">Last Month Winner</a>&nbsp;&nbsp;|&nbsp;&nbsp;</li>
							<li class="text_fff"><a href="../prize/prize notice.html" class="top_menu" onfocus="this.blur()">Prize Notice</a>&nbsp;&nbsp;|&nbsp;&nbsp;</li>
							<li class="text_fff"><a href="../prize/Prize Request_list.html" class="top_menu" onfocus="this.blur()">Prize Suggestion</a></li>
						</ul>
					</li>
					<li id="menu_3">
						<a href="../customer/information.html" onMouseOver="JsMenuView('3'),this.blur()" onfocus="JsMenuView('3'),this.blur();"><img src="../images/common/top_menu03_off.gif" alt="Customer Center"  border="0" id="menu_3_img" /></a>
						<ul id="submenu_3">
							<li class="text_fff"><a href="../customer/information.html" class="top_menu" onfocus="this.blur()">Information</a>&nbsp;&nbsp;|&nbsp;&nbsp;</li>
							<li class="text_fff"><a href="../customer/question.html" class="top_menu" onfocus="this.blur()"> Question & Request</a></li>
						</ul>
					</li>
					<li id="menu_4">
						<a href="../business/business.html" onMouseOver="JsMenuView('4'),this.blur()" onfocus="JsMenuView('4'),this.blur();"><img src="../images/common/top_menu04_off.gif" alt="Business Contact" border="0" id="menu_4_img" /></a>
						<ul id="submenu_4">
							<li></li>
						</ul>
					</li>
				</ul>
<%}
else if(request.getParameter("admin").equals("administrator3k")){%>
				<ul>
					<li id="menu_1">
						<a href="whatis.html?admin=administrator3k" onmouseover="JsMenuView('1');" onfocus="JsMenuView('1'),this.blur();"><img src="../images/common/top_menu01_off.gif" alt="Biz-Ring" border="0" id="menu_1_img" /></a>
						<ul id="submenu_1">
							<li class="text_fff"><a href="whatis.html?admin=administrator3k" class="top_menu" onfocus="this.blur()">What is Biz-Ring</a>&nbsp;&nbsp;|&nbsp;&nbsp;</li>
							<li class="text_fff"><a href="biz-ring.html?admin=administrator3k" class="top_menu" onfocus="this.blur()">Biz-Ring Now</a>&nbsp;&nbsp;|&nbsp;&nbsp;</li>
							<li class="text_fff"><a href="Advertising Schedule_list.html?admin=administrator3k" class="top_menu" onfocus="this.blur()">Advertising Schedule</a>&nbsp;&nbsp;|&nbsp;&nbsp;</li>
							<li class="text_fff"><a href="notice_list.html?admin=administrator3k" class="top_menu" onfocus="this.blur()">Notice</a>&nbsp;&nbsp;|&nbsp;&nbsp;</li>
							<li class="text_fff"><a href="price.html?admin=administrator3k" class="top_menu" onfocus="this.blur()">Price Notice</a></li>
						</ul>
					</li>
					<li id="menu_2">
						<a href="../prize/prize now.html?admin=administrator3k" onMouseOver="JsMenuView('2'),this.blur()" onFocus="JsMenuView('2'),this.blur();"><img src="../images/common/top_menu02_off.gif" alt="Prize" border="0" id="menu_2_img" /></a>
						<ul id="submenu_2">
							<li class="text_fff"><a href="../prize/prize now.html?admin=administrator3k" class="top_menu" onfocus="this.blur()">Prize Now</a>&nbsp;&nbsp;|&nbsp;&nbsp;</li>
							<li class="text_fff"><a href="../prize/last month.html?admin=administrator3k" class="top_menu" onfocus="this.blur()">Last Month Winner</a>&nbsp;&nbsp;|&nbsp;&nbsp;</li>
							<li class="text_fff"><a href="../prize/prize notice.html?admin=administrator3k" class="top_menu" onfocus="this.blur()">Prize Notice</a>&nbsp;&nbsp;|&nbsp;&nbsp;</li>
							<li class="text_fff"><a href="../prize/Prize Request_list.html?admin=administrator3k" class="top_menu" onfocus="this.blur()">Prize Suggestion</a></li>
						</ul>
					</li>
					<li id="menu_3">
						<a href="../customer/information.html?admin=administrator3k" onMouseOver="JsMenuView('3'),this.blur()" onfocus="JsMenuView('3'),this.blur();"><img src="../images/common/top_menu03_off.gif" alt="Customer Center"  border="0" id="menu_3_img" /></a>
						<ul id="submenu_3">
							<li class="text_fff"><a href="../customer/information.html" class="top_menu" onfocus="this.blur()">Information</a>&nbsp;&nbsp;|&nbsp;&nbsp;</li>
							<li class="text_fff"><a href="../customer/question.html" class="top_menu" onfocus="this.blur()"> Question & Request</a></li>
						</ul>
					</li>
					<li id="menu_4">
						<a href="../business/business.html?admin=administrator3k" onMouseOver="JsMenuView('4'),this.blur()" onfocus="JsMenuView('4'),this.blur();"><img src="../images/common/top_menu04_off.gif" alt="Business Contact" border="0" id="menu_4_img" /></a>
						<ul id="submenu_4">
							<li></li>
						</ul>
					</li>
				</ul>
<%}%>
			</div><!-- /navi-global -->
		</div>
	</div>

	<div id="container">
		<!-- left-->		
	    <h2 class="hidden">sub_menu</h2>
		<div id="left_part">
			<div id="left_menu">
<%if(request.getParameter("admin") == null){%>
				<ul>
					<p><img src="../images/biz-ring/left_title.gif" alt="Biz-Ring" /></p>
					<li><a href="whatis.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image23','','../images/biz-ring/left_menu01_on.gif',1)" onblur="MM_swapImgRestore()" onfocus="MM_swapImage('Image23','','../images/biz-ring/left_menu01_on.gif',1),this.blur()"><img src="../images/biz-ring/left_menu01_off.gif" name="Image23" width="161" border="0" id="Image23" alt="What is Biz-Ring" /></a></li>
					<li><a href="biz-ring.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image22','','../images/biz-ring/left_menu02_on.gif',1)" onblur="MM_swapImgRestore()" onfocus="MM_swapImage('Image22','','../images/biz-ring/left_menu02_on.gif',1),this.blur()"><img src="../images/biz-ring/left_menu02_off.gif" name="Image22" width="161" border="0" id="Image22" alt="Biz-Ring Now" /></a></li>
					<li><a href="Advertising Schedule_list.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image24','','../images/biz-ring/left_menu03_on.gif',1)" onblur="MM_swapImgRestore()" onfocus="MM_swapImage('Image24','','../images/biz-ring/left_menu03_on.gif',1),this.blur()"><img src="../images/biz-ring/left_menu03_off.gif" name="Image24" width="161" border="0" id="Image24" alt="Advertising Schedule" /></a></li>
					<li><a href="notice_list.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image25','','../images/biz-ring/left_menu04_on.gif',1)" onblur="MM_swapImgRestore()" onfocus="MM_swapImage('Image25','','../images/biz-ring/left_menu04_on.gif',1),this.blur()"><img src="../images/biz-ring/left_menu04_off.gif" name="Image25" width="161" border="0" id="Image25" alt="Notice" /></a></li>
					<li><a href="price.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image26','','../images/biz-ring/left_menu05_on.gif',1)" onblur="MM_swapImgRestore()" onfocus="MM_swapImage('Image26','','../images/biz-ring/left_menu05_on.gif',1),this.blur()"><img src="../images/biz-ring/left_menu05_off.gif" name="Image26" width="161" border="0" id="Image26" alt="Price Notice" /></a></li>
				</ul>
<%}
else if(request.getParameter("admin").equals("administrator3k")){%>
				<ul>
					<p><img src="../images/biz-ring/left_title.gif" alt="Biz-Ring" /></p>
					<li><a href="whatis.html?admin=administrator3k" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image23','','../images/biz-ring/left_menu01_on.gif',1)" onblur="MM_swapImgRestore()" onfocus="MM_swapImage('Image23','','../images/biz-ring/left_menu01_on.gif',1),this.blur()"><img src="../images/biz-ring/left_menu01_off.gif" name="Image23" width="161" border="0" id="Image23" alt="What is Biz-Ring" /></a></li>
					<li><a href="biz-ring.html?admin=administrator3k" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image22','','../images/biz-ring/left_menu02_on.gif',1)" onblur="MM_swapImgRestore()" onfocus="MM_swapImage('Image22','','../images/biz-ring/left_menu02_on.gif',1),this.blur()"><img src="../images/biz-ring/left_menu02_off.gif" name="Image22" width="161" border="0" id="Image22" alt="Biz-Ring Now" /></a></li>
					<li><a href="Advertising Schedule_list.html?admin=administrator3k" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image24','','../images/biz-ring/left_menu03_on.gif',1)" onblur="MM_swapImgRestore()" onfocus="MM_swapImage('Image24','','../images/biz-ring/left_menu03_on.gif',1),this.blur()"><img src="../images/biz-ring/left_menu03_off.gif" name="Image24" width="161" border="0" id="Image24" alt="Advertising Schedule" /></a></li>
					<li><a href="notice_list.html?admin=administrator3k" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image25','','../images/biz-ring/left_menu04_on.gif',1)" onblur="MM_swapImgRestore()" onfocus="MM_swapImage('Image25','','../images/biz-ring/left_menu04_on.gif',1),this.blur()"><img src="../images/biz-ring/left_menu04_off.gif" name="Image25" width="161" border="0" id="Image25" alt="Notice" /></a></li>
					<li><a href="price.html?admin=administrator3k" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image26','','../images/biz-ring/left_menu05_on.gif',1)" onblur="MM_swapImgRestore()" onfocus="MM_swapImage('Image26','','../images/biz-ring/left_menu05_on.gif',1),this.blur()"><img src="../images/biz-ring/left_menu05_off.gif" name="Image26" width="161" border="0" id="Image26" alt="Price Notice" /></a></li>
				</ul>
<%}%>
		    </div>
		</div>
	    <h2 class="hidden">contacts</h2>
		<div id="body_part">
			<div id="body_con">
				<p class="title" style="padding:72px 0 16px;"><img src="../images/biz-ring/sub_title01.gif" alt="Advertising Schedule" /></p>
				<div class="ta_top"></div>
				<div class="ta_bg">
					<div class="bs_con">
					<fieldset>
					<legend>schedule_list</legend>
						<table class="board01" cellpadding="0" cellspacing="0" border="0" summary="schedule_list">
							<caption style="position:absolute; width:0; height:0; font-size:0; line-height:0; overflow:hidden; visibility:hidden;">schedule_list</caption>
							<colgroup>
								<col style="width:150px" />
								<col style="" />
								<col style="width:110px" />
								<col style="width:110px" />
							</colgroup>
							<thead>
								<tr>
									<th scope="col"><img src="../images/biz-ring/board_title01.gif" alt="Date" align="absmiddle" /></th>
									<th scope="col"><img src="../images/biz-ring/board_title02.gif" alt="Title" align="absmiddle" /></th>
									<th scope="col"><img src="../images/biz-ring/board_title03.gif" alt="Advertisers" align="absmiddle" /></th>
									<th scope="col"><img src="../images/biz-ring/board_title04.gif" alt="Run" align="absmiddle" /></th>
								</tr>
							</thead>
							<tbody>
								<tr>
									<td colspan="4" height="10px" class="line"></td>
								</tr>
<%
	int rows = 12;
	int currPage = (request.getParameter("page") == null ? 1 : 
						request.getParameter("page").equals("0") ? 1 : Integer.parseInt(request.getParameter("page")));

	String connectionUrl = "jdbc:sqlserver://bizring.biz:14333;databaseName=bizring";
	String userid = "sa";
	String passwd = "qlalf@sql";
	
	// Declare the JDBC objects.
	java.sql.Connection con = null;
	java.sql.Statement stmt = null;
	java.sql.ResultSet rs = null;

	// Establish the connection.
	Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");

	try {   
		// Create and execute an SQL statement that returns some data.
		String SQL = "SELECT CONVERT(varchar, start_date, 106) as startdate, title, advertiser, status, RowNum FROM " +
					 "( SELECT t.start_date, t.title, t.advertiser, t.status, ROW_NUMBER() OVER (ORDER BY id desc) AS RowNum " +
			     	 "FROM ad_list t ) AS MyDerivedTable WHERE MyDerivedTable.RowNum BETWEEN " + 
			     	 (rows * (currPage - 1) + 1) + " AND " + (rows * currPage);
		
		
		con = java.sql.DriverManager.getConnection(connectionUrl, userid, passwd);
		stmt = con.createStatement();
		rs = stmt.executeQuery(SQL);
		int displayedRow = 0;
		
		// Iterate through the data in the result set and display it.
		while (rs.next()) {
			displayedRow++;
			out.println("<tr>");
			out.println("<td class=\"date\">" + rs.getString("startdate") + "</td>" + 
						"<td class=\"title\">" + rs.getString("title") + "</td>" + 
						"<td>" + rs.getString("advertiser") + "</td>" + 
						"<td>" + rs.getString("status") + "</td>");
			out.print("</tr>");
		}
		for (int i = displayedRow; i < 12; i++)
			out.println("<tr><td class=\"date\"></td><td class=\"title\"></td><td></td><td></td></tr>");
    } catch (java.sql.SQLException e) {   
        e.printStackTrace();   
    } finally{   
        try {   
            if(stmt !=null) stmt.close();   
            if(con !=null) con.close();   
        } catch (java.sql.SQLException e) {   
            e.printStackTrace();   
        }   
    }   
%>
								<tr>
									<td colspan="4" height="10px" class="line"></td>
								</tr>
							</tbody>
						</table>
						<div class="board_navigation">
<%
	
	try {
		String counter = "SELECT count(1) as counter FROM ad_list";
		con = java.sql.DriverManager.getConnection(connectionUrl, userid, passwd);
		stmt = con.createStatement();
		rs = stmt.executeQuery(counter);
		int pages = 0;
		while (rs.next()) {
			pages = rs.getInt(1);
		}
		
		String href = "";
		for (int i = 0;i < ((int)(Math.ceil((double)pages/rows))); i++) {
			if (i == currPage - 1)
				href = "<span class=\"text_red\">" + (i + 1) + "</span>";
			else
				href = "<a href=\"./adv_schedule?page=" + (i + 1) + "\">" + (i + 1) + "</a>";
			out.print(href + " ");
		}
	} catch (java.sql.SQLException e) {
		e.printStackTrace();
	} finally {
		try {   
            if(stmt !=null) stmt.close();   
            if(con !=null) con.close();   
        } catch (java.sql.SQLException e) {   
            e.printStackTrace();   
        }
	}
%>						
						</div>
					</fieldset>		
					</div>					
				</div>
				<div class="ta_bot"></div>
			</div>					
		</div>
	</div>

	<h2 class="hidden">copyright</h2>
	<div id="foot">
		<div id="foot_part">
			<p id="line_solid"></p>
			<div class="foot_adress">
				<ul>
					<li class="logo"><img src="../images/common/tsellogo.png" alt="Powered by TELKOMSEL" /></li>
					<li class="address">
						<div class="f_address">
							<address>
							<img src="../images/common/copyright.gif" alt="This site is The Telkomsel Small Ring Service website.   /   BizRing Operator : PT. Kami Kaya Kreasi
Address : Jl. Daksa IV, No. 69, Kebayoran Baru, Jakarta Selatan - 12110 Indonesia
Tel +62 21 723 5038  Fax +62 21 723 5037  info@kamikayakreasi.com
wwww.kamikayakreasi.com" />
							</address>					
						</div>
					</li>
				</ul>
			</div>	
		</div>
	</div>
 
</div>
</BODY>
</HTML>

